package com.example.administrator.compileapp.activity;

import android.databinding.DataBindingUtil;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.example.administrator.compileapp.BR;
import com.example.administrator.compileapp.R;
import com.example.administrator.compileapp.databinding.ActivityGoBinding;
import com.example.administrator.compileapp.until.CommentRecyclerAdapter;

import java.util.ArrayList;
import java.util.List;

public class GoActivity extends AppCompatActivity {
   private ActivityGoBinding binding;
    private CommentRecyclerAdapter<Object> adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
       binding= DataBindingUtil.setContentView(this, R.layout.activity_go);
        aboutRecycler();
    }

    private void aboutRecycler() {
        adapter = new CommentRecyclerAdapter<>(this,new ArrayList<>(), R.layout.go_items, BR.list);
        binding.recycler.setAdapter(adapter);
        int [] id = new int []{R.array.first,R.array.second,R.array.third,R.array.fourth};
        for (int i = 0; i < id.length; i++) {
            String[] strings = getResources().getStringArray(id[i]);
            List<String> list1 = new ArrayList<>();
            for (int j = 0; j < strings.length; j++) {
                list1.add(strings[j]);
            }
            adapter.add(list1);
        }

    }
}
